(function () {
  let type = location.search.split("=")[1];
  //console.log(decodeURI(type));
  let oUl = document.querySelector("ul");
  AG("/goods/list", { category: decodeURI(type) }).then((resData) => {
    console.log(resData.data);
    let listData = resData.data.list;
    let html = "";
    listData.forEach((item) => {
      html += `
        
        <li>
        <a href="detail.html?pid=${item.goods_id}"><img src="${item.img_big_logo}"></a>
        <p class="title">${item.title}</p>
        <p>${item.current_price}<del>${item.price}</del></p>
        </li>
        
        `;
    });
    oUl.innerHTML = html;
  });
})();
